package com.dcliment.jukebox.models
{
	import com.dcliment.jukebox.events.JukeBoxEvent;
	
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	public class JukeBoxModel extends EventDispatcher implements IJukeBoxModel
	{
		//
		private var _theStage:Stage;
		//
		private var _id:int = -1;
		//
		private var _totalPages:int;
		//
		private var _playState:Boolean;
		//
		private var _hideCursor:Boolean;
		
		
		public function JukeBoxModel($theStage:Stage)
		{
			
			_theStage = $theStage;
		}
		
		//----------------------------------
		public function get theStage():Stage
		{
			return _theStage;
		}
		// ---------------------------
		public function get id():int
		{
			return _id;
		}

		public function set id(value:int):void
		{
			if(value == _id)
				return;
			
			_id = value;
			
			dispatchEvent(new JukeBoxEvent(JukeBoxEvent.ID_CHANGE));
		}
		//------------------------------
		public function get totalPages():int
		{
			return _totalPages;
		}

		public function set totalPages(value:int):void
		{
			_totalPages = value;
		}
		//-------------------------------
		public function get playState():Boolean
		{
			return _playState;
		}

		public function set playState(value:Boolean):void
		{
			_playState = value;
			
			dispatchEvent(new JukeBoxEvent(JukeBoxEvent.PLAY_STATE_CHANGE));
		}
		//------------------------------
		public function get hideCursor():Boolean
		{
			return _hideCursor;
		}

		public function set hideCursor(value:Boolean):void
		{
			_hideCursor = value;
		}

	}
}